//
//  TabbarViewController.m
//  YiLiao
//
//  Created by Infinite on 16/7/1.
//  Copyright © 2016年 Infinite. All rights reserved.
//

#import "TabbarViewController.h"

//tabbar
#import "ChatViewController.h"

#import "MyPageViewController.h"
#import "NewsViewController.h"
#import "FileViewController.h"

@interface TabbarViewController ()

@end

@implementation TabbarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    ChatViewController * chatVC = [[ChatViewController alloc]init];
    FileViewController * fileVC = [[FileViewController alloc]init];
    MyPageViewController * mypageVC = [[MyPageViewController alloc]init];
    NewsViewController * newsVC =[[NewsViewController alloc]init];
    
    UINavigationController * chatNV = [[UINavigationController alloc]initWithRootViewController:chatVC];
    UINavigationController * fileNV = [[UINavigationController alloc]initWithRootViewController:fileVC];
    UINavigationController * mypageNV = [[UINavigationController alloc]initWithRootViewController:mypageVC];
    UINavigationController * newsNV = [[UINavigationController alloc]initWithRootViewController:newsVC];



    
    chatVC.tabBarItem.image=[UIImage imageNamed:@"main@2x"];
    chatVC.tabBarItem.title=@"聊天";
    
    fileVC.tabBarItem.image=[UIImage imageNamed:@"file@2x"];
    fileVC.tabBarItem.title=@"文件";
    
    mypageVC.tabBarItem.image=[UIImage imageNamed:@"person@2x"];
    mypageVC.tabBarItem.title=@"个人";
    
    newsVC.tabBarItem.image=[UIImage imageNamed:@"news@2x"];
    newsVC.tabBarItem.title=@"新闻";
    
    UITabBarController * tabbar = [[UITabBarController alloc]init];
    tabbar.viewControllers=@[chatNV,newsNV,fileNV,mypageNV];
    [UIApplication sharedApplication].delegate.window.rootViewController=tabbar;
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
